<html><head>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
<script language=javascript>
    function val()
  {
         if(document.form1.movieid.value=="")
	{
          alert("Enter the movie id");
		  return false;
	}
    else if(document.form1.moviename.value=="")
	{
          alert("Enter the movie name");
		  return false;
	}
     else if(document.form1.Mrating.value=="")
	{
          alert("select movie rating");
		return false;
	} 
     else if(document.form1.city.value=="")
	{
          alert("Enter city name");
		return false;
	}
     else if(document.form1.totaltickets.value=="")
	{
          alert("Enter totaltickets value");
		return false;
	}	
     else
           return true;
}
  </script>
<center><h1> Movie Delete Form</h1> </center> 
<style type="text/css">
div{
position:fixed;
top: 10px;
right:10px;
}
h1{
position:fixed;
top: 70px;
left:380px;
}

#moviename{
position:fixed;
top: 170px;
left:400px;
}
#form{
position:fixed;
top: 140px;
left:350px;
}


</style>

</head>
<body>
<?php
include_once ("common.php");
printHeader();
?>

<div>
<form name=form method=post action="search-feedback.php" onsubmit= "return val()">
  <input type=text name=moviefeedback size="12"><input type=submit value="search movie"></td>
</form>
</div>


<form name=form1 method=post action="moviedelete.php" onsubmit= "return val()">

<center>
<table id="moviename">
<tr><td>Movie name</td><td><select name="movieID">
<?php
require_once ('config.php');

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$con) {
	die('Could not connect: ' . mysql_error());
}

mysql_select_db(DB_DATABASE, $con);

$sql = "select ID, name from movielist ";

$rs = mysql_query($sql);

while ($row = mysql_fetch_array($rs)) {
	echo "<option value=\"" . $row['ID'] . "\">" . $row['name'] . "\n  ";

}
?>
</select>
</td></tr>
<tr><td/><td><input type="submit" value="Delete"/></td></tr>
</table>
<br><br>

</center>

</form>
</body>
</html>